﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Interfaces.Web.Twitter
{
    /// <summary>
    /// This class represents an abstract layer for all twitter data collectors.
    /// </summary>
    [Serializable]
    public abstract class AbstractDataCollector
    {
        /// <summary>
        /// This field holds the user list of the accounts from which the information should be collected.
        /// </summary>
        private readonly List<string> userlist;

        /// <summary>
        /// This field holds the connection information of the twitter account.
        /// </summary>
        private Connection connectionInformation;

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractDataCollector"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information of the twitter account.</param>
        protected AbstractDataCollector(Connection connectionInformation)
        {
            this.userlist = new List<string>();
            this.connectionInformation = connectionInformation;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractDataCollector"/> class.
        /// </summary>
        /// <param name="connectionInformation">The connection information of the twitter account.</param>
        /// <param name="userlist">The user list of the accounts from which the information should be collected.</param>
        protected AbstractDataCollector(Connection connectionInformation, List<string> userlist)
        {
            if (userlist == (List<string>) null)
            {
                throw new ArgumentNullException("userlist");
            }

            this.userlist = userlist;
            this.connectionInformation = connectionInformation;
        }

        /// <summary>
        /// Gets the user list of the accounts from which the information should be collected.
        /// </summary>
        /// <value>The user list of the accounts from which the information should be collected.</value>
        public List<string> Userlist
        {
            get { return userlist; }
        }

        /// <summary>
        /// Gets or sets the connection information of the twitter account.
        /// </summary>
        /// <value>The connection information of the twitter account.</value>
        public Connection ConnectionInformation
        {
            get { return connectionInformation; }
            set { connectionInformation = value; }
        }
    }
}